using System;
using System.Collections.Generic;
using System.Text;

using NHibernate;
using NHibernate.Data.Models;
using NHibernate.Data.Base;

namespace NHibernate.Data.Managers
{
    public partial interface IRegionManager : IManagerBase<Region, long>
    {
		// Get Methods
		IList<Region> GetByClimate(System.Int64 climate);
		IList<Region> GetByIntroduction(System.Int64 introduction);
		IList<Region> GetByLocalName(System.Int64 localName);
		IList<Region> GetByOriginCountry(System.Int64 originCountry);
		IList<Region> GetByParentRegion(System.Int64 parentRegion);
    }

    partial class RegionManager : ManagerBase<Region, long>, IRegionManager
    {
		#region Constructors
		
		public RegionManager() : base()
        {
        }
        public RegionManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<Region> GetByClimate(System.Int64 climate)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Region));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("Climate", climate));
			
			return criteria.List<Region>();
        }
		
		public IList<Region> GetByIntroduction(System.Int64 introduction)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Region));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("Introduction", introduction));
			
			return criteria.List<Region>();
        }
		
		public IList<Region> GetByLocalName(System.Int64 localName)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Region));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("LocalName", localName));
			
			return criteria.List<Region>();
        }
		
		public IList<Region> GetByOriginCountry(System.Int64 originCountry)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Region));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("OriginCountry", originCountry));
			
			return criteria.List<Region>();
        }
		
		public IList<Region> GetByParentRegion(System.Int64 parentRegion)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Region));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("ParentRegion", parentRegion));
			
			return criteria.List<Region>();
        }
		
		#endregion
    }
}